#pragma once
#include "QD3D/QD3DTimeQuery.h"
#include "QD3D/QD3DResourcePack.h"
#include "QD3D/QD3DUtils.h"
#include <sstream>
#include <d3d11.h>
#include <QVector>
#include <glm/glm.hpp>

class SumPrimitive
{
public:
	CONST_STRUCT_BEGIN(ConstVars)
		UINT totalElemNum;
	CONST_STRUCT_END

	SumPrimitive (QD3DResourcePack *pDataPack,
			QD3DResourcePack *pResultPack, UINT elemNum,
			UINT structSize, const std::string &structBufType);
	~SumPrimitive ();

	void run ();

private:
	UINT _elemNum;

	ID3D11Buffer *_pGroupSizeDxConstBuf;

	QVector< QD3DResourcePack * > _tempPackPtrs;

	ID3D11ComputeShader *_p_sumCS;
};